<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据验证-validator</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.js"></script>
</head>
<body>
<div id="case13-demo8">
    <foo-component v-bind:foo-message="fooMessage"></foo-component>
</div>
<script type="text/javascript">
    var case13Demo8=new Vue({
        el:"#case13-demo8",
        data:{
            fooMessage:130
        },
        components:{
            "foo-component":{
                props:{
                    fooMessage: {
                        validator:function (value) {
                            return value>=0&&value<=128;
                        }
                    }
                },
                template:'<div>{{fooMessage}}</div>'
            }
        }
    })
</script>
</body>
</html>